package com.ruibang.glass.iso.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.ruibang.glass.common.utils.validateannotation.NotBlank;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.time.LocalDate;
import java.util.List;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-06-05  15:28
 * @Description: TODO：文件管理实体
 * @Version: 1.0
 */

@Data
@TableName(value = "g_iso_file_manage",autoResultMap = true)
public class FileManage extends BaseEntity {
    @TableId(value = "manage_id", type = IdType.ASSIGN_ID)
    @ApiModelProperty("主键ID")
    private String manageId;

    @ApiModelProperty("申请人用户ID")
    @NotBlank(message = "申请人不可为空")
    private String applyUserId;

    @ApiModelProperty("部门ID")
    @NotBlank(message = "部门不可为空")
    private String deptId;

    @ApiModelProperty("部门名称")
    @TableField(exist = false)
    private String deptName;

    @ApiModelProperty("文件名称")
    @NotBlank(message = "文件名称不可为空")
    private String fileName;

    @ApiModelProperty("文件类别ID")
    @NotBlank(message = "文件类别不可为空")
    private String fileCategoryId;

    @ApiModelProperty("文件编号")
    private String fileNo;

    @ApiModelProperty("保密等级")
    @NotBlank(message = "保密等级不可为空")
    private String secrecyLevel;

    @ApiModelProperty("原因")
    private String reason;

    @ApiModelProperty("下发用户ID")
    @TableField(value = "distribute_user_id", typeHandler = JacksonTypeHandler.class)
    private List<String> distributeUserId;

    @ApiModelProperty("下发部门ID")
    @NotEmpty(message = "下发部门不可为空")
    @TableField(value = "distribute_dept_id", typeHandler = JacksonTypeHandler.class)
    private List<String> distributeDeptId;

    @ApiModelProperty("通知用户ID")
    @TableField(value = "notify_user_id", typeHandler = JacksonTypeHandler.class)
    private List<String> notifyUserId;

    @ApiModelProperty("通知部门ID")
    @TableField(value = "notify_dept_id", typeHandler = JacksonTypeHandler.class)
    private List<String> notifyDeptId;

    @ApiModelProperty("修订内容")
    private String reviseContent;

    @ApiModelProperty("是否会签  1:是  0:否")
    @NotBlank(message = "是否会签不可为空")
    private String isCountersign;

    @ApiModelProperty("会签部门")
    @TableField(value = "countersign_dept_id", typeHandler = JacksonTypeHandler.class)
    private List<String> countersignDeptId;

    @ApiModelProperty("操作类型: (1：新增，2：修订，3：更新，4：废止) 字典:iso_operation_type")
    @NotBlank(message = "操作类型不可为空")
    private String operationType;

    @ApiModelProperty("发布日期")
    private LocalDate releaseDate;

    @ApiModelProperty("保管年限")
    private Integer storagePeriod;

    @ApiModelProperty("版本")
    private Integer version;

    @ApiModelProperty("更新人ID")
    private String updateUserId;

    @ApiModelProperty("更新人名称")
    @TableField(exist = false)
    private String updateUserName;

    @ApiModelProperty("正文文件")
    private String fileId;

    @TableLogic
    private String isAbolished;

    @ApiModelProperty("文件数")
    @TableField(exist = false)
    private int fileNum;

    @ApiModelProperty("附件")
    @TableField(exist = false)
    private List<String> attachmentIds;

    @ApiModelProperty("文件类别名称")
    @TableField(exist = false)
    private String fileCategoryName;

    @ApiModelProperty("文件级别")
    @TableField(exist = false)
    private String fileLevel;

    @ApiModelProperty("申请人用户名称")
    @TableField(exist = false)
    private String applyUserName;

    @ApiModelProperty("菜单ID")
    @NotBlank(message = "菜单ID不可为空")
    private String menuId;

    @ApiModelProperty("审批状态")
    private String approveStatus;

    @ApiModelProperty("是否最新(0:否，1:是)")
    private String isNewest;

    @ApiModelProperty("流程Id")
    @TableField(exist = false)
    private String processId;

    @ApiModelProperty("废止Id")
    private String abolishId;
}